<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<style>
.st{
width: 30px;
height: 30px;
background: #ff00ff;
}
</style>
<fieldset><legend>Таблица умножения</legend>
<table id="" name="">
<tr>
<td><div id="1st" class="st"></div></td>
<td>* </td>
<td> <div id="2st" class="st"></div> </td>
<td> =</td>
<td> <input type="text" size="1" id="3st" class="st"></td>
<td> <input type="button" id="xbut" class="" value="Ответ" title=""></td>
</tr>
</table>
</fieldset>
<script>
var a=(Math.floor(Math.random() * 9 + 1));
var b=(Math.floor(Math.random() * 9 + 1));
var c=a*b;
$("#1st").html(a);
$("#2st").html(b);
$("#xbut").click(function(){
var d=(document.getElementById("3st").value);
if (c==d)
{
alert("OK");
}
else{
alert("Folse");
}
}
);
</script>
|
|